<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <link rel="shortcut icon" href="../../src/images/bitbug_favicon.ico" type="image/x-icon">
  <meta name="keywords" content="your keywords">
  <meta name="description" content="your description">
  <meta name="author" content="author,email address">
  <meta name="robots" content="index,follow">
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  <meta name="renderer" content="ie-stand">
  <title>仁和区党群服务一号通暨群众意见受理中心</title>
  <link rel="stylesheet" href="../../src/css/base.css">
  <link rel="stylesheet" href="../../src/css/common.css">
  <link rel="stylesheet" href="../../src/css/tpl.css">
  <link rel="stylesheet" href="../../src/css/user_center.css">
    <script src="../../src/js/libs/es5-shim.min.js"></script>   <script src="../../src/js/libs/es5-sham.min.js"></script>    <script src="../../src/js/libs/json3.min.js"></script> </head>

<body>
  <div class="page">
    <div id="header">
    </div>
    <div class="menu-bar">
      <div class="container">
        <span>
              <span class="crumb-name">当前你的位置：</span>>
        </span>
        <span>
              <a class="" href="../Home/Index.html">首页</a>>
            </span>
        <span>投诉处理</span>
      </div>
    </div>
    <div class="container">
    </div>
    <!--正文-->
    <div class="mid_container clearfix">
      <div class="left_guide">
        <h1 class="left_guide_top_size">
          投诉处理
        </h1>
        <div class="left_guide_decorate">
        </div>
        <div class="left_about_us">
          COMPLAIN HANDING
        </div>
        <div class="left_white_about active">
          <a href="Index.html"><span class="left_cn_about_us">投诉处理</span></a>
        </div>
      </div>
      <div class="mid_guide">
        <div class="mid_guide_content tabs">
          <div class="title">
            <div class="tab-item">
              <ul class="clearfix js_item">
                <li class="active" typeid="0">全部</li>
                <li typeid="1">待处理</li>
                <li typeid="2">受理中</li>
                <li typeid="3">待评价</li>
                <li typeid="4">已完结</li>
              </ul>
            </div>
          </div>
          <div class="work_content content" id="list_html">
          </div>
          <div id="page1" class="laypage"></div>
        </div>
      </div>
    </div>
  </div>
  <div id="footer">
  </div>
  <script id="list_tpl" type="text/html">
    {{each resultdata val idx}}
    <div class="work_content_item">
      <div class="row_1 clearfix">
        <span class="fl">投诉编号：{{val.id}}</span>
        <span class="fr">{{val.status | _status}}</span>
      </div>
      <div class="row_2 clearfix">
        <img class="fl" src="../../src/images/p_3.png" alt="">
        <div class=" fl row_2_mid">
          <div class="title">{{val.title}}</div>
          <div class="date">{{val.createtime}}</div>
        </div>
        <div class="fr row_2_r">
          {{if val.status == 1 || val.status == 2 || val.status == 3}}
          <a class="btn_2" href="../Complain/Detail.html?id={{val.id}}">详情</a>
          <a class="btn_2 type_2" href="../Complain/Cancel.html?{{val.id}}">取消投诉</a> {{/if}} {{if val.status == 4}}
          <a href="../Complain/Detail.html?id={{val.id}}">评价</a> {{/if}} {{if val.status >= 5}}
          <a href="../Complain/Detail.html?id={{val.id}}">详情</a> {{/if}}
        </div>
        <div class="fr row_2_r">
        </div>
      </div>
    </div>
    {{/each}} {{if resultdata.length === 0}}
    <div class="empty_box">
      <img src="../../src/images/null_state.png" alt="">
    </div>
    {{/if}}
  </script>
  <script src="../../src/js/libs/jquery.1.12.4.js"></script>
  <script src="../../src/js/libs/template-web.js"></script>
  <script src="../../src/js/libs/laypage/laypage.js"></script>
  <script src="../../src/js/base/common.js"></script>
  <script>
    var params = {
      userid: document.cookie.split(";")[1].split("=")[1],
      page: 1,
      typeid: '0'
    }

    var pageindex = 5
    
    window.onload = function () {
      $('.navigation li').eq(5).addClass('active')
    }

    $('.js_item li').on('click', function () {
      params.typeid = $(this).attr('typeid')
      $(this).addClass('active').siblings().removeClass('active')
      getList(params, params.page)
    })

    template.defaults.imports._status = function (val) {
      var arr = ['待处理', '待审核', '处理中', '待评价', '已完结', '已取消', '网格化管理员待处理', '网格化管理员已处理', '审核失败']
      val = parseInt(val) - 1
      return arr[val] ? arr[val] : '其他'
    };

    function getList(params, page) {
      $.ajax({
        type: "GET",
        url: "http://221.10.2.222:5680/api/ow/Complain/List/",
        dataType: "json",
        data: {
          'userid': params.userid,
          'page': page,
          'querystatus': params.typeid
        },
        success: function (res) {
          if (!res.resultdata) {
            res = {
              resultdata: []
            }
          } else {
            res.resultdata = JSON.parse(res.resultdata)
            res.count = JSON.parse(res.count)
          }
          var html = template('list_tpl', res);
          $('#list_html').html(html)
          laypage({
            cont: 'page1',
            pages: Math.ceil(res.count / 6),
            curr: page || 1,
            first: false,
            last: false,
            prev: '<',
            next: '>',
            jump: function (obj, first) {
              if (!first) {
                getList(params, obj.curr);
              }
            }
          });
        }
      })
    }

    getList(params, params.page)
  </script>
</body>

</html>